Skip to content

Conversation

fmayer
Copy link
Contributor

@fmayer fmayer commented Oct 22, 2024

No description provided.

Created using spr 1.3.4
@llvmbot llvmbot added backend:AArch64 llvm:mc Machine (object) code labels Oct 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 22, 2024

@llvm/pr-subscribers-backend-aarch64

Author: Florian Mayer (fmayer)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/113390.diff

1 Files Affected:

  • (modified) llvm/test/MC/AArch64/global-tagging.ll (+33-15)
diff --git a/llvm/test/MC/AArch64/global-tagging.ll b/llvm/test/MC/AArch64/global-tagging.ll
index c8b3f52401dc11..75453e9bb62056 100644
--- a/llvm/test/MC/AArch64/global-tagging.ll
+++ b/llvm/test/MC/AArch64/global-tagging.ll
@@ -9,9 +9,12 @@
 ; RUN: llvm-mc -filetype=obj %t.S -triple=aarch64-linux-android31 -o %t.o
 ; RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=CHECK-RELOCS
 
-; RUN: obj2yaml %t.o -o %t.yaml
-; RUN: FileCheck %s --input-file=%t.yaml --check-prefix=CHECK-YAML
+; RUN: obj2yaml %t.o -o %t.o.yaml
+; RUN: FileCheck %s --input-file=%t.o.yaml --check-prefix=CHECK-OYAML
 ; RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=CHECK-RELOCS
+; RUN: ld.lld %t.o -o %t.so
+; RUN: obj2yaml %t.so -o %t.so.yaml
+; RUN: FileCheck %s --input-file=%t.so.yaml --check-prefix=CHECK-SOYAML
 
 ;; Check we don't create relocations referencing a section symbol for sanitize_memtag globals.
 ; CHECK-RELOCS:      Relocation section '.rela.text' {{.*}} contains 4 entries:
@@ -27,19 +30,34 @@
 ; CHECK-RELOCS:     R_AARCH64_NONE {{.*}} huge
 ; CHECK-RELOCS-NOT: specialcaselisted
 
-; CHECK-YAML:      Sections:
-; CHECK-YAML:      - Name: .rela.memtag.globals.static
-; CHECK-YAML-NOT:  - Name:
-; CHECK-YAML:      Relocations:
-; CHECK-YAML-NEXT: - Symbol: internal_four
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: four
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: sixteen
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: huge
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: -
+; CHECK-OYAML:      Sections:
+; CHECK-OYAML:      - Name: .rela.memtag.globals.static
+; CHECK-OYAML-NOT:  - Name:
+; CHECK-OYAML:      Relocations:
+; CHECK-OYAML-NEXT: - Symbol: internal_four
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: four
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: sixteen
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: huge
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: -
+
+;; Value: 0x{{.*}}0 checks for 16-alignment of address
+; CHECK-SOYAML: Symbols:
+; CHECK-SOYAML:  - Name: internal_four
+; CHECK-SOYAML:    Value: 0x{{.*}}0
+; CHECK-SOYAML:  - Name: four
+; CHECK-SOYAML:    Value: 0x{{.*}}0
+; CHECK-SOYAML:  - Name: sixteen
+; CHECK-SOYAML:    Value: 0x{{.*}}0
+; CHECK-SOYAML:  - Name: huge
+; CHECK-SOYAML:    Value: 0x{{.*}}0
+;; At least as currently laid out, specialcaselisted gets put adjacient to a
+;; tagged global, so it also has to be aligned to the next granule.
+; CHECK-SOYAML:  - Name: specialcaselisted
+; CHECK-SOYAML:    Value: 0x{{.*}}0
 
 ; CHECK-ASM: .memtag internal_four
 ; CHECK-ASM .p2align        4

@llvmbot
Copy link
Member

llvmbot commented Oct 22, 2024

@llvm/pr-subscribers-mc

Author: Florian Mayer (fmayer)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/113390.diff

1 Files Affected:

  • (modified) llvm/test/MC/AArch64/global-tagging.ll (+33-15)
diff --git a/llvm/test/MC/AArch64/global-tagging.ll b/llvm/test/MC/AArch64/global-tagging.ll
index c8b3f52401dc11..75453e9bb62056 100644
--- a/llvm/test/MC/AArch64/global-tagging.ll
+++ b/llvm/test/MC/AArch64/global-tagging.ll
@@ -9,9 +9,12 @@
 ; RUN: llvm-mc -filetype=obj %t.S -triple=aarch64-linux-android31 -o %t.o
 ; RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=CHECK-RELOCS
 
-; RUN: obj2yaml %t.o -o %t.yaml
-; RUN: FileCheck %s --input-file=%t.yaml --check-prefix=CHECK-YAML
+; RUN: obj2yaml %t.o -o %t.o.yaml
+; RUN: FileCheck %s --input-file=%t.o.yaml --check-prefix=CHECK-OYAML
 ; RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=CHECK-RELOCS
+; RUN: ld.lld %t.o -o %t.so
+; RUN: obj2yaml %t.so -o %t.so.yaml
+; RUN: FileCheck %s --input-file=%t.so.yaml --check-prefix=CHECK-SOYAML
 
 ;; Check we don't create relocations referencing a section symbol for sanitize_memtag globals.
 ; CHECK-RELOCS:      Relocation section '.rela.text' {{.*}} contains 4 entries:
@@ -27,19 +30,34 @@
 ; CHECK-RELOCS:     R_AARCH64_NONE {{.*}} huge
 ; CHECK-RELOCS-NOT: specialcaselisted
 
-; CHECK-YAML:      Sections:
-; CHECK-YAML:      - Name: .rela.memtag.globals.static
-; CHECK-YAML-NOT:  - Name:
-; CHECK-YAML:      Relocations:
-; CHECK-YAML-NEXT: - Symbol: internal_four
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: four
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: sixteen
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: - Symbol: huge
-; CHECK-YAML-NEXT: Type: R_AARCH64_NONE
-; CHECK-YAML-NEXT: -
+; CHECK-OYAML:      Sections:
+; CHECK-OYAML:      - Name: .rela.memtag.globals.static
+; CHECK-OYAML-NOT:  - Name:
+; CHECK-OYAML:      Relocations:
+; CHECK-OYAML-NEXT: - Symbol: internal_four
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: four
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: sixteen
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: - Symbol: huge
+; CHECK-OYAML-NEXT: Type: R_AARCH64_NONE
+; CHECK-OYAML-NEXT: -
+
+;; Value: 0x{{.*}}0 checks for 16-alignment of address
+; CHECK-SOYAML: Symbols:
+; CHECK-SOYAML:  - Name: internal_four
+; CHECK-SOYAML:    Value: 0x{{.*}}0
+; CHECK-SOYAML:  - Name: four
+; CHECK-SOYAML:    Value: 0x{{.*}}0
+; CHECK-SOYAML:  - Name: sixteen
+; CHECK-SOYAML:    Value: 0x{{.*}}0
+; CHECK-SOYAML:  - Name: huge
+; CHECK-SOYAML:    Value: 0x{{.*}}0
+;; At least as currently laid out, specialcaselisted gets put adjacient to a
+;; tagged global, so it also has to be aligned to the next granule.
+; CHECK-SOYAML:  - Name: specialcaselisted
+; CHECK-SOYAML:    Value: 0x{{.*}}0
 
 ; CHECK-ASM: .memtag internal_four
 ; CHECK-ASM .p2align        4

@fmayer fmayer requested a review from pcc October 22, 2024 22:21
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
@fmayer fmayer changed the base branch from users/fmayer/spr/main.nfc-mte-add-more-tests-for-globals to main October 22, 2024 22:24
Created using spr 1.3.4
; RUN: obj2yaml %t.o -o %t.o.yaml
; RUN: FileCheck %s --input-file=%t.o.yaml --check-prefix=CHECK-OYAML
; RUN: llvm-readelf -r %t.o | FileCheck %s --check-prefix=CHECK-RELOCS
; RUN: ld.lld %t.o -o %t.so
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think LLD is built as part of check-llvm so I would expect this to fail unless a new-enough LLD happens to be on $PATH. The new test probably needs to be added to LLD instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 llvm:mc Machine (object) code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants